package com.itheima.a01;

import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

import java.io.IOException;

/**
 * 1.加载类路径下的文件
 * 2.加载jar包中的文件
 */
public class PathMatchingResourcePatternResolverDemo {
    public static void main(String[] args) throws IOException {
        PathMatchingResourcePatternResolver pathMatchingResourcePatternResolver = new PathMatchingResourcePatternResolver();
        Resource[] resources = pathMatchingResourcePatternResolver
                .getResources("classpath*:META-INF/spring.factories");
        for (Resource resource : resources) {
            System.out.println(resource);
        }
        System.out.println("===========================================");
        Resource[] resources2 = pathMatchingResourcePatternResolver
                .getResources("/**/META-INF/spring.factories");
        for (Resource resource : resources2) {
            System.out.println(resource);
        }
    }
}
